<h3>Редактирование отзыва: "<a href="<?php echo $this->createUrl('review/view', array('id' => $model->getId(), 'url' => $model->getDbData('url'))); ?>"><?php echo $model->getDbData('title'); ?>"</a></h3>	 
<div class="padTop20"></div>
<div class="floatL leftBlock" style="min-width: 650px;">
    <div class="floatL addForm radius5">  
	<form action="<?php echo $this->createUrl('/review/add'); ?>" method="post" id="addReview" class="form-stacked">	
	    <input type="hidden" name="review[id]" value="<?php echo $model->getId(); ?>">
	    <label for="review[title]">Тема:</label>
	    <input type="text" name="review[title]" value="<?php echo $model->getDbData('title'); ?>" autocomplete="off"><br />	    
	    <div class="padTop20"></div>    
	    <label for="review[content]">Описание: </label>
	    <textarea name="review[content]"><?php echo $model->getDbData('content'); ?></textarea><br />	    
	    <div class="padTop20"></div>    
	    <label for="category">Категория</label>		    
	    <input type="hidden" name="review[category_id]" id="categoryId" value="<?php echo ($model->getCategory() ? $model->getCategory()->getId() : false); ?>">	    	    
	    <div class="cats">
		<input type="text" name="category" value="<?php echo ($model->getCategory() ? $model->getCategory()->getDbData('title') : false); ?>" id="category" autocomplete="off" /><br />    	    
	    </div>
	    <div class="padTop20"></div>    
	    <label for="review[user_rating]">Ваша оценка</label>		
	    <div id="rating" style="overflow: hidden;">
		<input type="radio" class="star"  name="review[user_rating]" value="1" <?php echo ($model->getDbData('user_rating') == 1 ? 'checked="checked"' : false); ?>/>
		<input type="radio" class="star"  name="review[user_rating]" value="2" <?php echo ($model->getDbData('user_rating') == 2 ? 'checked="checked"' : false); ?>/>
		<input type="radio" class="star"  name="review[user_rating]" value="3" <?php echo ($model->getDbData('user_rating') == 3 ? 'checked="checked"' : false); ?>/>
		<input type="radio" class="star"  name="review[user_rating]" value="4" <?php echo ($model->getDbData('user_rating') == 4 ? 'checked="checked"' : false); ?>/>		
		<input type="radio" class="star"  name="review[user_rating]" value="5" <?php echo ($model->getDbData('user_rating') == 5 ? 'checked="checked"' : false); ?>/>
	    </div>

	    <div id="upImage" class="supList <?php echo (!$model->getImages() ? 'hide' : false); ?>">
		<div class="padTop20"></div>    
		<label for="imageList"><img src="/themes/miky/images/icons/photo_marker.png"/>Фото:</label>
		<ul id="imageList">
		    <?php if ($model->getImages()) : ?>
			<?php foreach ($model->getImages() as $image): ?>
			    <li id="advImage_<?php echo $image->getId(); ?>">
				<span><?php echo $image->getDbData('real_name'); ?></span>
				<a href="<?php
		    echo implode(DIRECTORY_SEPARATOR, array(
			Yii::app()->params['uploadDirectory'],
			$image->getDbData('path'),
			'thumb',
			$image->getDbData('thumb_name')
		    ));
			    ?>" title="<?php echo $image->getDbData('thumb_name'); ?>" rel="prettyPhoto">посмотреть</a>
				<a href="<?php
			   echo implode(DIRECTORY_SEPARATOR, array(
			       Yii::app()->params['uploadDirectory'],
			       $image->getDbData('path'),
			       'origin',
			       $image->getDbData('real_name')
			   ));
			    ?>" title="<?php echo $image->getDbData('real_name'); ?>" rel="prettyPhoto">оригинал</a>
				<a href="javascript:void(0)" title="<?php echo $image->getDbData('thumb_name'); ?>" onclick="$.data(container, 'features').remove(<?php echo $image->getId(); ?>, 'image');">удалить</a>
			    </li>
			<?php endforeach; ?>
		    <?php endif; ?>
		</ul>	
		<?php if ($model->getImages()) : ?>
		    <?php foreach ($model->getImages() as $image): ?>
			<input name="features[image][]" type="hidden" id="hiddenImage_<?php echo $image->getId(); ?>" value="<?php echo $image->getId(); ?>">
		    <?php endforeach; ?>
		<?php endif; ?>
	    </div>	    

	    <div id="upVideo" class="supList <?php echo (!$model->getVideos() ? 'hide' : false); ?>">
		<div class="padTop20"></div>
		<label for="videoList"><img src="/themes/miky/images/icons/video_marker.png">Видео:</label>
		<ul id="videoList">		
		    <?php if ($model->getVideos()) : ?>
			<?php foreach ($model->getVideos() as $video): ?>
			    <li id="advVideo_<?php echo $video->getId(); ?>">
				<span><?php echo $video->getDbData('real_name'); ?></span>
				<a href="javascript:void(0)" title="Удалить" onclick="$.data(container, 'features').remove(<?php echo $video->getId(); ?>, 'video');">удалить</a>
			    </li>
			<?php endforeach; ?>
		    <?php endif; ?>
		</ul>	
		<?php if ($model->getVideos()) : ?>
		    <?php foreach ($model->getVideos() as $video): ?>
			<input name="features[video][]" type="hidden" id="hiddenVideo_<?php echo $video->getId(); ?>" value="<?php echo $video->getId(); ?>">
		    <?php endforeach; ?>
		<?php endif; ?>
	    </div>	    
	    <div id="upMap" class="supList <?php echo (!$model->getMaps() ? 'hide' : false); ?>">
		<div class="padTop20"></div>
		<label for="mapList"><img src="/themes/miky/images/icons/map_marker.png">Метки на карте:</label>
		<ul id="mapList">	
		    <?php if ($model->getMaps()) : ?>
			<?php foreach ($model->getMaps() as $map): ?>
			    <li id="advMap_<?php echo $map->getId(); ?>">
				<span><?php echo $map->getAddress(); ?></span>
				<a href="javascript:void(0)" title="Удалить" onclick="$.data(container, 'features').remove(<?php echo $map->getId(); ?>, 'map');">удалить</a>
			    </li>		
			<?php endforeach; ?>
		    <?php endif; ?>
		</ul>		
		<?php if ($model->getMaps()) : ?>
		    <?php foreach ($model->getMaps() as $map): ?>
			<input name="features[map][]" type="hidden" id="hiddenMap_<?php echo $map->getId(); ?>" value="<?php echo $map->getId(); ?>">
		    <?php endforeach; ?>
		<?php endif; ?>
	    </div>
	    <div class="padTop20"></div>    
	    <input type="button" class="btn primary" value="Добавить изображение" onclick="openPane('img')" />
	    <input type="button" class="btn danger margLeft10" value="Добавить видео" onclick="openPane('video')"/>
	    <input type="button" class="btn success margLeft10" value="Указать место на карте" onclick="openPane('map')"/>	    
	    <div class="padTop20"></div>
	    <input type="submit" name="save" value="Сохранить" class="btn" id="save" />
	</form>	
    </div>
</div>
<?php if (!Yii::app()->user->getIsGuest()) : ?>
    <?php echo $this->renderPartial('webroot.themes.' . Yii::app()->theme->name . '.views.partials.features-form'); ?>
<?php endif; ?>